package com.poc.compass;

import java.util.List;
import java.util.Map;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.demo.compass.controller.Buscador;
import com.demo.persistencia.generica.modelo.Employee;


public class SearchInCompass {

/**
* @param args
*/
public static void main(String[] args) {

        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
                new String[] {
                 	   "classpath:/conf/applicationContext-compass-base.xml", 
                 	   "classpath:/conf/applicationContext-Config.xml",
                 	  "classpath:/conf/applicationContext-dao.xml",
                 	 "classpath:/conf/applicationContext-listaHiberXml.xml"});
        System.out.println("<>");
        Buscador searchDAO = (Buscador) applicationContext.getBean("searchDao");
        String searchText = "suy";

        Map<String, List<Employee>> retorno =  searchDAO.search(searchText);
        Object obj = new Employee();
        String objectName = obj.getClass().getName();
       List<Employee> lst = retorno.get(objectName);
       System.out.println(lst.get(0).toString());

}
}